﻿namespace BorgExt
{
    internal class ReflectionEventHandler
    {
        private readonly EventHandlerInfo _eventHandlerInfo;
        private readonly object _target;

        public ReflectionEventHandler(EventHandlerInfo eventHandlerInfo, object target)
        {
            _eventHandlerInfo = eventHandlerInfo;
            _target = target;
        }

        public void Invoke(object args)
        {
            _eventHandlerInfo.Invoke(_target, new[] { args });
        }
    }
}

